#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

static vector<uint> simplify(uint a, uint b) {
    uint c = gcd(a, b);
    return {a / c, b / c};
}

static vector<uint> inexperienced(uint x, uint y) {
    uint a = x / 10;
    uint b = x % 10;
    uint c = y / 10;
    uint d = y % 10;
    if (b == 0 && d == 0)
        return {0, 0};
    if (a == c)
        return simplify(b, d);
    if (a == d)
        return simplify(b, c);
    if (b == c)
        return simplify(a, d);
    if (b == d)
        return simplify(a, c);
    return {0, 0};
}

int main() {
    uint a = 1;
    uint b = 1;
    for (uint i = 10; i < 100; ++i) {
        for (uint j = i + 1; j < 100; ++j) {
            auto t = inexperienced(i, j);
            if (t[0] && t[0] < t[1] && simplify(i, j) == t) {
                cout << i << ' ' << j << endl;
                a *= i;
                b *= j;
            }
        }
    }
    auto r = simplify(a, b);
    cout << r[1] << endl; // 100
}